//	--------------------------------------------------------------------
//	Copyright(C) 2006,2007 Zhao Yukun. All rights reserved.
//	This file is a part of the Xeres system.
//	Xeres 2007
//	Contact : xeres.engine@gmail.com
//	$(reservedInfo)
//	$(reservedDeclaration)
//	--------------------------------------------------------------------
///	@file	<CShaderAdapter10.h>
///	@path	~/src/graphics/dx10/
///	@date	2008/12/29
///	@desc	.

#pragma once

#include "xeres.h"

#include "graphics/IShaderAdapter.h"
#include "graphics/IEffect.h"
#include "graphics/ITechnique.h"
#include "graphics/dx10/CDevice10.h"
#include "graphics/dx10/CTechnique10.h"

namespace xeres {

	/*! 
		\class	CShaderAdapter10
		\brief
	*/
	class CShaderAdapter10 : public IShaderAdapter
	{
	public:

		/// \ctor
		CShaderAdapter10( ID3D10InputLayout * layout , RefWeak<IShader> shader );

		/// \dtor
		virtual ~CShaderAdapter10( void );

		DECL_IOBJECT_CLASS( CShaderAdapter10 , IShaderAdapter );

	public:

		/// \name Shader Adapter Interface
		//@{

		/*! 
			\brief	Get adapted technique.
		*/
		virtual RefWeak<IShader> AdaptShader( RenderContext& rc );

		/*! 
			\brief	Assemble shader (only valid in DX10 mode).
		*/
		virtual void AssembleShader( RenderContext& rc );

		/*! 
			\brief	Draw geometry with adapted shader.
		*/
		virtual void Draw( RenderContext& rc , RefWeak<IGeometry> geo );

		//@}

	private:

		//@ data
		ID3D10InputLayout *		m_layout;
		Ref<IShader>			m_shader;
	};
	
} // namespace xeres
